<html>
  <head><title>SP Objects</title>
    <script src="codepress/codepress.js" type="text/javascript"></script> 
    <link rel="stylesheet" href="style.css" type="text/css" media="all" />
  </head>
  <body>

    <h1>Procedure Object: F_QT_CUST_RDC.SQL</h1>
    <p><b>Author:</b> </p>
    <p><b>Date:</b> </p>
    <p><b>Abstract:</b></p>
    <p></b></p>
    <p><b>Sample Calls:</b></p>
    <p>    values EBIZ1.F_QT_CUST_RDC(char('0000400015'),'USA')<br>  </b></p>
    <p></p>
    
    
    
    
    
    
    
    
    
    <h3>Source code:</h3>
    <div id="SQLsrc" >
<em>DROP</em>&nbsp;SPECIFIC&nbsp;<b>FUNCTION</b>&nbsp;EBIZ1.F_QT_CUST_RDC<br />@<br /><em>CREATE</em>&nbsp;<b>FUNCTION</b>&nbsp;EBIZ1.F_QT_CUST_RDC&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;piCustNum&nbsp;<u>CHAR</u>(10),<br />&nbsp;&nbsp;&nbsp;&nbsp;PICNTRYCODE&nbsp;<u>VARCHAR</u>(3)<br />)&nbsp;<b>RETURNS</b>&nbsp;<u>VARCHAR</u>(360)<br />&nbsp;&nbsp;&nbsp;&nbsp;SPECIFIC&nbsp;EBIZ1.F_QT_CUST_RDC<br />&nbsp;&nbsp;&nbsp;&nbsp;<b>LANGUAGE</b>&nbsp;<b>SQL</b><br />&nbsp;&nbsp;&nbsp;&nbsp;<b>NOT</b>&nbsp;DETERMINISTIC<br />&nbsp;&nbsp;&nbsp;&nbsp;READS&nbsp;<b>SQL</b>&nbsp;DATA<br />&nbsp;&nbsp;&nbsp;&nbsp;<b>NO</b>&nbsp;EXTERNAL&nbsp;ACTION<br /><i>-------------------------------------------------------------------------------</i><br /><i>--&nbsp;&nbsp;<b>Function</b>&nbsp;Name:&nbsp;F_QT_CUST_RDC</i><br /><i>--&nbsp;&nbsp;File&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;F_QT_CUST_RDC.<b>SQL</b></i><br /><i>--</i><br /><i>--&nbsp;&nbsp;Author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;Bill&nbsp;Wang</i><br /><i>--&nbsp;&nbsp;<u>Date</u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;03/20/2007</i><br /><i>--</i><br /><i>--&nbsp;&nbsp;Abstract</i><br /><i>--&nbsp;&nbsp;&nbsp;&nbsp;<b>Get</b>&nbsp;customer&nbsp;RDC&nbsp;base&nbsp;<b>on</b>&nbsp;<b>input</b>&nbsp;parameters.</i><br /><i>--</i><br /><i>--&nbsp;&nbsp;Sample&nbsp;Calls:</i><br /><i>--&nbsp;&nbsp;&nbsp;&nbsp;<b>values</b>&nbsp;EBIZ1.F_QT_CUST_RDC(<u>char</u>(<s>'0000400015'</s>),<s>'USA'</s>)</i><br /><i>--</i><br /><i>--</i><br /><i>--&nbsp;&nbsp;Maintenance&nbsp;Log</i><br /><i>--&nbsp;&nbsp;&nbsp;&nbsp;who&nbsp;&nbsp;<u>date</u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><em>comment</em></b></i><br /><i>--&nbsp;&nbsp;&nbsp;&nbsp;---&nbsp;&nbsp;--------&nbsp;&nbsp;---------------------------------------------------------------</i><br /><i>--&nbsp;&nbsp;&nbsp;&nbsp;Will&nbsp;&nbsp;01/08/08&nbsp;&nbsp;initial&nbsp;version</i><br /><i>--&nbsp;&nbsp;&nbsp;&nbsp;Will&nbsp;&nbsp;01/09/08&nbsp;&nbsp;Allow&nbsp;PICNTRYCODE&nbsp;=&nbsp;<s>'%'</s></i><br /><i>-----------------------------------------------------------------------------------</i><br /><em>BEGIN</em>&nbsp;ATOMIC<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<em>DECLARE</em>&nbsp;vCustRDC&nbsp;<u>VARCHAR</u>(360)&nbsp;<b>DEFAULT</b>&nbsp;<s>''</s>;<br />&nbsp;&nbsp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bsp;<b>FOR</b>&nbsp;v1&nbsp;<b>AS</b>&nbsp;<br />	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>SELECT</em>&nbsp;cust_num&nbsp;&nbsp;<b>FROM</b>&nbsp;&nbsp;RDHB2.IBM_CUST_REF&nbsp;<br />	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>WHERE</b>&nbsp;&nbsp;IBM_CUST_NUM&nbsp;=&nbsp;piCustNum<br />	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>AND</b>&nbsp;CNTRY_CODE&nbsp;=&nbsp;PICNTRYCODE<br />	&nbsp;&nbsp;&nbsp;&nbsp;DO<br />	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>SET</em>&nbsp;vCustRDC&nbsp;=&nbsp;vCustRDC&nbsp;||&nbsp;cust_num&nbsp;||&nbsp;<s>','</s>;<br />	&nbsp;&nbsp;&nbsp;&nbsp;<em>END</em>&nbsp;<b>FOR</b>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>END</em>&nbsp;<b>IF</b>;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<b>RETURN</b>&nbsp;vCustRDC;<br /><em>END</em><br />@<br />CALL&nbsp;DTOL.G_FN_EXEC_GRP(<s>'EBIZ1'</s>,&nbsp;<s>'F_QT_CUST_RDC'</s>,&nbsp;<s>'public'</s>)<br />@<br />
    </div> 
  </body>
</html>
